    /**
     * Delete the given {{ model_name }}.
     *
     * @param  int  $id
     * @return Redirect
     */
    public function getDelete($id = null)
    {
        // Check if the {{ model_name }} exists
        if (is_null(${{ model_name }} = {{ model_class }}::find($id)))
        {
            // Redirect to the {{ model_class }} management page
            return Redirect::to('{{ route_prefix }}.{{ model_name }}.index')->with('error', 'There was an issue deleting the {{ model_class }}. Please try again.');
        }

        {# TODO: check permission to delete
        // Do we have permission to delete this user?
        if ($user->isSuperUser() and ! Sentry::getUser()->isSuperUser())
        {
            // Redirect to the user management page
            return Redirect::route('users')->with('error', 'Insufficient permissions!');
        }
        #}

        // Delete the {{ model_name }}
        ${{ model_name }}->delete();

        // Redirect to the {{ model_class }} list page
        return Redirect::route("{{ route_prefix }}.{{ model_name }}.index")->with('success', '{{ model_class }} was successfully deleted.');
    }
{% if softdelete %}

    /**
    * Restore a deleted {{ model_name }}.
    *
    * @param  int  $id
    * @return Redirect
    */
    public function getRestore($id = null)
    {
        try
        {
            // Get {{ model_name }} information
            ${{ model_name }} = {{ model_class }}::withTrashed()->find($id);

            // Restore the {{ model_name }}
            ${{ model_name }}->restore();

            // Redirect to the {{ model_class }} management page
            return Redirect::route('{{ route_prefix }}.{{ model_name }}.index')->with('success', '{{ model_class }} was successfully restored.');
        }
        catch (NotFoundException $e)
        {
            // Redirect to the {{ model_class }} management page
            return Redirect::route('{{ route_prefix }}.{{ model_name }}.index')->with('error', "{{ model_class }} [$id] does not exist.");
        }
    }
{% endif %}
